package com.cxkj.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import com.cxkj.dao.UsersMapper;
import com.cxkj.dto.Users;
import com.cxkj.service.UserService;
@Service("userService")
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UsersMapper usermMapper;

	public Users userLogin(String userName, String password) {
		
		return usermMapper.userLogin(userName, password);
	}

	public void insertUser(Users users,Model model) {
		users.setUcreatetime(new Date());
		users.setUstatus("1");
		int add = usermMapper.insertSelective(users);
		System.out.println("新增"+add+"条用户信息");
		model.addAttribute("result", "用户添加成功");
	}

	public List<Users> nameTest(String username) {
		
		return usermMapper.nameTest(username);
		
	}
	
	
	
	
	

}
